import Vue from 'vue'
import ElementUI from 'element-ui'
import App from './App.vue'
import router from './router'
import ajax from '@/services/ajax'
import request from '@/services/request'
import lang from '@/services/lang'
import './assets/common/css/all'
import './assets/common/css/theme/index.css'
import './assets/common/css/pages.styl'
import './assets/font/css/font-awesome.css'
import hostConfig from '@/services/hostConfig'

// 全局环境变量
window.permissionCheckUrl = 'platform/v1/access/resources'

// 动态设置全局环境变量
window.host = hostConfig[process.env.NODE_ENV]

// 插件配置
Vue.use(ElementUI)

Vue.config.productionTip = false

// 国际语言初始化
lang.init()

// 设置请求头
request.init()

// axios 统一配置
ajax.init()

/* eslint-disable */
new Vue({
  el: '#app',
  router,
  template: '<App/>',
  components: { App },
  data: {
    eventBus: new Vue()
  }
})
